package gen.kaynak.navitrack.messageProcessStrategy;

import gen.kaynak.navitrack.messageProcessState.MessageProcessStateManager;

public class SignExistenceCheckWithLetterProcessor implements
		IMessageProcessStrategy {

	@Override
	public boolean ProcessChar(char c, MessageProcessStateManager mpm) {
		if (mpm.getNowProcessing() == "Latitude") {
			if (mpm.signIsNotAssigned()) {
				switch (c) {
				case 'n':
					mpm.setSign("+");
				case 'N':
					mpm.setSign("+");
				case 's':
					mpm.setSign("-");
				case 'S':
					mpm.setSign("-");
				default:
					return false;
				}
			}
			return true;
		} else if (mpm.getNowProcessing() == "Longitude") {
			if (mpm.signIsNotAssigned()) {
				switch (c) {
				case 'e':
					mpm.setSign("+");
				case 'E':
					mpm.setSign("+");
				case 'w':
					mpm.setSign("-");
				case 'W':
					mpm.setSign("-");
				default:
					return false;
				}
			}
			return true;
		} else {
			return false;
		}
	}

}
